package com.acme.task2;

public class GCTest {
	byte array[] = new byte[1024];

	public static void main(String[] args) {
		
		int numberOfIterations = 91000000;
		Object[] array = new Object[91000000];
		for (int i = 0; i < numberOfIterations; i++) {
			
			Foo foo = new Foo(i);
			array[i] = foo;
			//No object is destroyed!
		}
	}
}
/**
    * 15080499
    *Exception in thread "main" java.lang.OutOfMemoryError: GC overhead limit exceeded
    *Destruction is just too slow!
    *No object is destroyed!
	*at java.lang.Integer.toString(Unknown Source)
	*at java.lang.String.valueOf(Unknown Source)
	*at java.io.PrintStream.print(Unknown Source)
	*at java.io.PrintStream.println(Unknown Source)
	*at com.acme.task2.Foo.<init>(Foo.java:5)
	*at com.acme.task2.GCTest.main(GCTest.java:12)
 */
